package cn.chinawyny.boot.bootdemo.services.impl;

import cn.chinawyny.boot.bootdemo.services.MyService;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
@Endpoint(id = "helloService")
public class MyServiceImpl implements MyService {

    @Override
    @Cacheable("helloCache")
    public String printHello() {
        System.out.println("Hello");
        return "我是测试打印内容";
    }

    @Override
    @ReadOperation
    public Boolean isAccess() {
        return true;
    }
}
